Only test timestamp preservation for $(flavor)-el
authorRob Browning <rlb@defaultvalue.org>
Fri, 27 Nov 2015 20:23:45 +0000 (14:23 -0600)
committerRob Browning <rlb@defaultvalue.org>
Fri, 27 Nov 2015 20:23:50 +0000 (14:23 -0600)
Only check el.gz timestamp preservation when $(flavor)-el is one of
the packages being built (so the canary file will actually be there),
but go ahead and fix up the timestamps across all packages.

Thanks to David Matthew Mattli <dmm@mattli.us> for reporting the
problem.

Closes: 805904
debian/rules

index 9b083febd9f39747e194e8519691ef6b3c416d6f..1fe9afcf34fa22c29860076b9fd18ba7f3b6a256 100755 (executable)
@@ -610,20 +610,27 @@ override_dh_strip:
 # This won't be necessary once strip-nondeterminism is fixed.
 .PHONY: override_dh_strip_nondeterminism
 override_dh_strip_nondeterminism:
-       cp -a debian/emacs24-el/usr/share/emacs/24.5/lisp/version.el.gz \
-         debian/elgz-canary
-       find debian/$(flavor)-el -name "*.el.gz" -printf "%T@ %p\0" \
-         > debian/elgz-info
+       if grep "$(flavor)-el" <(dh_listpackages); then \
+         cp -a debian/emacs24-el/usr/share/emacs/24.5/lisp/version.el.gz \
+           debian/elgz-canary; \
+       fi
+       cd debian && \
+       find $$(dh_listpackages) -name "*.el.gz" -printf "%T@ %p\0" > elgz-info
        dh_strip_nondeterminism
-       set -eo pipefail; while read -r -d $$'\0' line; do \
-         ts="$${line%% *}"; \
-         path="$${line#* }"; \
-         touch --date=@"$$ts" "$$path"; \
-       done < debian/elgz-info
-       test ! debian/elgz-canary -nt \
-         debian/emacs24-el/usr/share/emacs/24.5/lisp/version.el.gz
-       test ! debian/elgz-canary -ot \
-         debian/emacs24-el/usr/share/emacs/24.5/lisp/version.el.gz
+       set -eo pipefail; \
+         cd debian; \
+         while read -r -d $$'\0' line; do \
+           ts="$${line%% *}"; \
+           path="$${line#* }"; \
+           touch --date=@"$$ts" "$$path"; \
+         done < elgz-info
+       if grep -q "$(flavor)-el" <(dh_listpackages); then \
+         set -e; \
+         test ! debian/elgz-canary -nt \
+           debian/emacs24-el/usr/share/emacs/24.5/lisp/version.el.gz; \
+         test ! debian/elgz-canary -ot \
+           debian/emacs24-el/usr/share/emacs/24.5/lisp/version.el.gz; \
+       fi
 
 override_dh_testdir:
        $(testdir)